<?php



global $_GPC, $_W;

$GLOBALS['frames'] = $this->getMainMenu();

//获取分类

$type=pdo_getall('zh_gjhdbm_type',array('uniacid'=>$_W['uniacid']));

$city=pdo_getall('zh_gjhdbm_city',array('uniacid'=>$_W['uniacid']));
/*if($_GPC['id']){

$sql="select a.*,b.tk_name,b.type,b.money,b.total_num,b.limit_num,b.bm_check from ".tablename(zh_gjhdbm_activity)." a left join".tablename('zh_gjhdbm_ticket')." b on a.id=b.activity_id where a.id={$_GPC['id']}";
$list=pdo_fetch($sql);
}*/

$list = pdo_get('zh_gjhdbm_activity',array('id'=>$_GPC['id']));

if(checksubmit('submit')){
  $data['title']=$_GPC['title'];
  $data['link_tel']=$_GPC['link_tel'];
  $data['logo']=$_GPC['logo'];
  $data['start_time']=strtotime($_GPC['start_time']);
  $data['end_time']=strtotime($_GPC['end_time']);
  $data['activity_type']=$_GPC['activity_type'];
  $data['join_type']=$_GPC['join_type'];
  $data['content']=html_entity_decode($_GPC['content']);
  $data['type_id']=$_GPC['type_id'];
  $data['status']='2';
  $data['cityname']=$_GPC['cityname'];
  $data['address']=$_GPC['address'];
  $data['coordinates']=$_GPC['coordinates'];
  $data['cost']=$_GPC['cost'];
  $data['sh_time']=time();
  $data['time']=time();
  $data['uniacid']=$_W['uniacid'];
  $rst=pdo_update('zh_gjhdbm_activity',$data,array('id'=>$_GPC['id']));

if($rst){
 message('操作成功！', $this->createWebUrl('sponsoractivity'), 'recommend');
}else{
  message('操作失败！','','error');
}

}



include $this->template('web/addsponsoractivity');